﻿using UnityEngine;
using System.Collections;

public class Zzz_Script : MonoBehaviour {

	public Vector3 decreaseSpeed = new Vector3 (1.7f, 1.7f, 1.7f);

	// Use this for initialization
	void Start () {
		gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(7.0f, 10.0f, 0.0f));
	}
	
	// Update is called once per frame
	void Update () {


		if (gameObject.transform.localScale.magnitude > 1.8f &&  decreaseSpeed.x > 0) {
			decreaseSpeed = -decreaseSpeed;
		}
		gameObject.transform.localScale += (Time.deltaTime * decreaseSpeed);

		if(gameObject.transform.localScale.magnitude < 0.1f){
			Destroy (gameObject);
		}
	}
}
